package pres.wchen.oa.cor.shiro.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pres.wchen.oa.cor.shiro.dao.BusinessmenInformationMapper;
import pres.wchen.oa.cor.shiro.dao.SysPermissionMapper;
import pres.wchen.oa.cor.shiro.model.BaseModel;
import pres.wchen.oa.cor.shiro.model.BusinessmenInformation;
import pres.wchen.oa.cor.shiro.service.BusinessmenInformationService;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @作者： wchen
 * @描述：
 * @创建时间： 2018/1/25 19:26
 * @版本：Copyright 2018, Inc. All Rights Reserved.
 * @修改信息：
 */
@Service
public class BusinessmenInformationServiceImp extends BaseService implements BusinessmenInformationService {

    @Autowired
    private BusinessmenInformationMapper businessmenInformationMapper;


    /**
     * @param businessmenInformation
     * @方法描述 新增
     * @创建作者 wchen
     * @方法入参 map
     * @返回值
     * @创建日期 2018/1/25
     */
    @Override
    public Integer insert(BusinessmenInformation businessmenInformation) {
        businessmenInformationMapper.insert(businessmenInformation);
        return businessmenInformation.getId();
    }

    /**
     * @param id
     * @方法描述 删除
     * @创建作者 wchen
     * @方法入参 map
     * @返回值
     * @创建日期 2018/1/25
     */
    @Override
    public Integer delete(Long id) {
        return businessmenInformationMapper.delete(id);
    }

    /**
     * @param businessmenInformation
     * @方法描述 更新
     * @创建作者 wchen
     * @方法入参 map
     * @返回值
     * @创建日期 2018/1/25
     */
    @Override
    public Integer update(BusinessmenInformation businessmenInformation) {
        return businessmenInformationMapper.update(businessmenInformation);
    }

    /**
     * @param id
     * @方法描述 详情
     * @创建作者 wchen
     * @方法入参 Long
     * @返回值
     * @创建日期 2018/1/25
     */
    @Override
    public BusinessmenInformation info(Long id) {
        Map map = new HashMap();
        map.put("id", id);
        return businessmenInformationMapper.info(map);
    }

    /**
     * @param map
     * @方法描述 列表
     * @创建作者 wchen
     * @方法入参 map
     * @返回值
     * @创建日期 2018/1/25
     */
    @Override
    public BaseModel list(Map map) {
        super.pagingList(map);
        List<BusinessmenInformation> list = businessmenInformationMapper.list(map);
        return super.doPagingResult(list);
    }
}
